<template>
  <Container class="storesign-edit">
    <!-- 基础设置 -->
    <div class="container-header title title-center" slot="header">
      查看签约门店
      <Button
        size="large"
        class="fl btn-back"
        icon="ios-arrow-back"
        @click="jumpPrevPage"
      >返回</Button>
    </div>
    <Tabs v-model="tab" type="card" size="small">
      <TabPane label="基础信息" name="tab0" />
      <TabPane label="签约信息" name="tab1" />
      <TabPane label="门店照片" name="tab2" />
      <TabPane label="门店身份证" name="tab3" />
      <TabPane label="签约记录" name="tab4" />
      <TabPane label="扫码地址" name="tab5" />
    </Tabs>
    <div class="tab-content">
      <StoreBaseInfoItem :form="form" v-show="tab=='tab0'" />
      <StoreInfoItem :form="form" v-show="tab=='tab1'" />
      <StorePictures :form="form" v-show="tab=='tab2'" />
      <IDcardPictures :form="form" v-show="tab=='tab3'" />
      <ChangeInfo :form="form" v-show="tab=='tab4'" />
      <AddressMap :form="form" v-if="tab=='tab5'" />
    </div>
    
    <!--<div class="container-footer bg-white" slot="footer">-->
      <!--<Button type="primary" size="large" class="ml" @click="onShowList">保存</Button>-->
      <!--<Button type="primary" size="large" class="ml" @click="onShowList">取消</Button>-->
    <!--</div>-->
  </Container>
</template>
<script>
  import StoreBaseInfoItem from "../storesign/edit/StoreBaseInfoItem";
  import StoreInfoItem from "../storesign/edit/StoreInfoItem";
  import StorePictures from '../storesign/edit/StorePicturesItem'
  import ChangeInfo from '../storesign/edit/ChangeInfoItem'
  import AddressMap from '../storesign/edit/AddressMapItem'
  import IDcardPictures from '../storesign/edit/IDcardPicturesItem'

  export default {
    name: "",
    components: {
      StoreBaseInfoItem,
      StoreInfoItem,
      StorePictures,
      ChangeInfo,
      AddressMap,
      IDcardPictures,
    },
    data() {
      return {
        tab: 'tab1',
        form: {
          cardz: [],
          cardf: [],
          yyzz: [],
          storeContractAgreementDTOList: [],
          storeContractChangeLogDTOList: [],
          empowerBrandDTOList: [],
          storeContractDTO: {
            distributorId: '',
            distributorName: '',
            storeContractBrandDTOList: [],
            storeContractAgreementDTO: {}
          },
          storeDTO: {}
        }
      }
    },
    mounted() {
      this.id = this.$route.query.id
      this.getData()
    },
    methods: {
      getData() {
        if (!this.id) return
        this.$ajaxGet(`/contract_store/detail/${this.id}`).then(res => {
          this.form = Object.assign(this.form, res)
          if (!this.form.storeContractDTO.storeContractExtDTO) {
            this.form.storeContractDTO.storeContractExtDTO = {}
          }
          if (!this.form.storeContractDTO.storeContractAgreementDTO) {
            this.form.storeContractDTO.storeContractAgreementDTO = {}
          }
        })
      },
      jumpPrevPage() {
        this.$router.back()
      },
    }
  };
</script>
